Skip to content

Add VECTOR and BSON data types support#16

Open
okramarenko wants to merge 7 commits intoadd10supportfrom
add_vector
Open

Add VECTOR and BSON data types support#16
okramarenko wants to merge 7 commits intoadd10supportfrom
add_vector

Conversation

@okramarenko
Copy link
Copy Markdown
Collaborator

@okramarenko okramarenko commented Apr 28, 2026

Note

Medium Risk
Touches core protocol metadata parsing, row/parameter serialization, and session initialization, so mis-parsing or incorrect byte conversions could affect query correctness and bulk load behavior for affected columns.

Overview
Adds opt-in support for SingleStore extended data types BSON and VECTOR by introducing SingleStoreExtendedTypeCode metadata in ColumnDefinitionPayload and routing reads through new vector-aware ColumnReader implementations.

Extends type mapping/schema and parameter handling: adds SingleStoreDbType.Bson/Vector, surfaces VECTOR dimensions/element type on SingleStoreDbColumn, serializes VECTOR/BSON values via new SingleStoreBinaryValueConverter, and updates SingleStoreBulkCopy to load these types using UNHEX(@var):>BSON / :>VECTOR(dims, type) expressions.

Adds a new connection-string option EnableExtendedDataTypes that, when enabled, executes SET SESSION enable_extended_types_metadata = TRUE on open (and re-applies it on connection reset) with a server-version guard (>= 8.5.28).

Reviewed by Cursor Bugbot for commit 64c0676. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/SingleStoreConnector/Protocol/Payloads/ColumnDefinitionPayload.cs Outdated
Comment thread src/SingleStoreConnector/Core/TypeMapper.cs Outdated
Comment thread src/SingleStoreConnector/SingleStoreParameter.cs
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 64c0676. Configure here.

valueBytes.CopyTo(bytes, i * sizeof(double));
}
return bytes;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big-endian double conversion missing NET5 optimization path

Low Severity

ConvertDoublesToBytes uses the BitConverter.GetBytes/Array.Reverse fallback on big-endian platforms, but ConvertFloatsToBytes (and the corresponding VectorFloat64ColumnReader) both use BinaryPrimitives.WriteDoubleLittleEndian/ReadDoubleLittleEndian under #if NET5_0_OR_GREATER. The double converter is functionally correct but inconsistent with every other conversion method in the PR.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 64c0676. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant